<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script src="static/js/font_1693746_l88lqiaavxa.js"></script>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/font_1693746_l88lqiaavxa.css">
  <title>开发助手高效版-网页版极致cms开发助手</title>
</head>
<body>
<div class="tool-container clearfix">
  <div class="menu">
    <span></span>
  </div>
  <div class="tool-nav" style="display: none;">
    <a href="index.html">导航菜单</a>
    <a href="site.html">站点信息</a>
    <a href="index-page.html">指定栏目</a>
    <a href="index-list.html">指定文章列表</a>
    <a href="index-product.html">指定商品列表</a>
    <a href="sort.html">当前栏目</a>
    <a href="banner.html">轮播图</a>
    <a href="article-list.html">文章列表</a>
    <a href="article-details.html">文章详情</a>
    <a href="productlist.html">产品列表</a>
    <a href="product.html">产品详情</a>
    <a href="pics.html">多图遍历</a>
    <a href="fenye.html">分页</a>
    <a href="">表单留言</a>
    <a href="search.html">搜索列表</a>
    <a href="if.html">IF判断</a>
    <a href="en.html">多语言建站</a> 
    <a href="select.html">多条件筛选</a>
    <a href="label.html">全局标签</a>
    <a href="user.html">会员登录注册</a>
    <a href="javascript:;">无刷新点赞</a>
    <a href="link.html">友情链接</a>
    <a href="other.html">其他</a>
  </div>
  <div class="tool-left">
    <div class="english">
      <a href="en.html"><svg class="icon" aria-hidden="true"><use xlink:href="#iconchina"></use></svg>CN <svg class="icon" aria-hidden="true"><use xlink:href="#iconmeiguo"></use></svg>EN</a>
    </div>
    <div class="logo-search container">
      <a href="site.html" class="logo">极致CMS开发助手</a>
      <a href="search.html" class="search">
        <span>请输入关键词</span>
        <span>搜索</span>
      </a>
      <a href="user.html" class="login">
        <span>登录/注册</span>
      </a>
    </div>
    <div class="header">
      <ul class="navbar clearfix">
        <li><a href="index.html">首页</a></li>
        <li><a href="productlist.html">产品列表</a></li>
        <li><a href="product.html">产品详情</a></li>
        <li><a href="article-list.html">文章列表</a></li>
        <li><a href="article-details.html">文章详情</a></li>
        <li><a href="page.html">单页</a></li>
        <li><a href="label.html">全局标签</a></li>
        <li><a href="other.html">其他</a></li>
      </ul>
    </div>
    <div class="banner container">
      <a href="banner.html"><img src="static/picture/banner.png" alt=""></a>
    </div>
    <div class="index-main container">
      <a href="index-page.html">
        <h3>公司简介</h3>
        <p>欢迎您使用极致CMS商业版, 希望我们的建站系统能够让您在使用的时候感到快乐~郑重承诺极致CMS商业版程序无后门，无限制，全开源，不收授权费，长期运营至死方休。</p>
      </a>
    </div>
    <div class="index-main container">
      <a href="index-product.html">
        <h3>产品展示</h3>
        <span>IMG1</span>
        <span>IMG2</span>
        <span>IMG3</span>
        <span>IMG4</span>
        <span>IMG5</span>
      </a>
    </div>
    <div class="index-foot clearfix">
      <a href="index-list.html" class="index-news">
        <h4>公司新闻</h4>
        <ul>
          <li>新闻标题 <span>2020-03-12</span></li>
          <li>新闻标题 <span>2020-03-12</span></li>
          <li>新闻标题 <span>2020-03-12</span></li>
          <li>新闻标题 <span>2020-03-12</span></li>
          <li>新闻标题 <span>2020-03-12</span></li>
        </ul>
      </a>
      <a href="" class="index-form">
        <h4>留言板</h4>
        <div class="form-item">
          <span class="input">请输入您的姓名</span>
        </div>
        <div class="form-item">
          <span class="input">请输入您的电话</span>
        </div>
        <div class="form-item">
          <span class="button">提交</span>
        </div>
      </a>
      <a href="company.html" class="index-contact">
        <h4>联系我们</h4>
        <div class="index-contact-item">
          <p>联系人：HOUJUN</p>
          <p>QQ：11329827</p>
          <p>地址：成都市青羊区</p>
        </div>
      </a>
    </div>
    <div class="index-link container">
      <a href="link.html">
        友情链接：<span>极致CMS</span><span>菜鸟教程</span>
      </a>
    </div>
    <a href="site.html" class="index-footer">
      <p><span>&copy;2020 极致CMS版权所有</span></p>
      <p><span>蜀ICP备2021016482号</span></p>
    </a>
  </div>
  <div class="tool-right">
    <div class="tool-code">
      <h2>极致CMS开发助手</h2>
      <div class="tool-code-box" id="tool-code1">

        <div class="code-box code-case">
          <h3>留言相关示例</h3>
          <div class="tab-hd">
            <span class="active">留言默认表单</span>
            <span>ajax提交留言</span>
            <span>万能表单</span>
          </div>
          <div class="tab-bd">
<div class="textarea-box">
  <textarea name="" id="" rows="10">
<form action ="{fun U('message/index')}" method="post">
<input name="tid" value="{$type['id']}" type="hidden">
标题：<input name="title" value="" type="text">
留言姓名：<input name="user" value="" type="text">
留言邮箱：<input name="email" value="" type="text">
留言内容：<input name="body" value="" type="text">
更多字段请仿照填写...
<input type="submit" value="提交">
</form></textarea><button onclick="copyTextarea()">COPY</button>
</div>
<div class="textarea-box" style="display: none;">
  <textarea name="" id="" rows="30">
<form  id="f_form" >
    <input type="hidden" name="title" value="我想电话咨询">
    <input type="hidden" name="ajax" value="1">
    <p><input type="text"  placeholder="请输入姓名" name="user"></p>
    <p><input type="radio" name="xingbie" checked value="2"> 女士<input type="radio" id="f_sex_next" name="xingbie"  value="1"> 男士</p>
    <p><input type="text" placeholder="请输入手机号码" name="tel" ></p>
    <p><input type="text" placeholder="请输入你想咨询的内容" name="body"></p>
    <p><a href="javascript:" onclick="tijiao()" >我想咨询</a></p>
</form>
<script>
    function tijiao(){
        var data = $('#f_form').serializeArray();
        $.post('{fun U('message/index')}',
            data,function(res){
                if(res.code==0){
                    alert('提交成功！');
                    window.location.reload();//刷新页面
                }else{
                    alert(res.msg);//弹出错误提示
                    window.location.reload();
                }
                
            },'json')
    }
</script>
//window.location.reload()刷新当前页面.
//parent.location.reload()刷新父亲对象（用于框架）
//opener.location.reload()刷新父窗口对象（用于单开窗口）
//top.location.reload()刷新最顶端对象（用于多开窗口）</textarea><button onclick="copyTextarea()">COPY</button>
</div>
<div class="textarea-box" style="display: none;">
  <textarea name="" id="" rows="30">
<form action="{fun U('message/index')}" onsubmit="return checkform()" method="POST">
<input name="tid" type="hidden" value="{$type['id']}" >
<div class="form-group"><label>*您的称呼</label><input name="user" id="user" class="form-control" type="text"></div>
<div class="form-group"><label>*您咨询的问题</label><input name="title" id="title" class="form-control" type="text"></div>
<div class="form-group"><label>*您的手机号</label><input name="tel" id="tel" class="form-control" type="tel"></div>

<!--后台新增的扩展字段在这里输出-->
<span id="ext_fields"></span>

<div class="form-group"><label>*问题描述</label>
<input name="body" id="body" class="form-control"></div>
<div class="form-group"><button class="btn btn-primary btn-block" type="submit">确定发送</button></div>
</form>

<script>
<!--需要引入jquery-->
	function checkform(){
		var user = $.trim($("#user").val());
		var title = $.trim($("#title").val());
		var email = $.trim($("#email").val());
		var tel = $.trim($("#tel").val());
		var body = $.trim($("#body").val());
		if(user==''){
			alert('您的称呼不能为空~');$("#user").focus();return false;
		}
		if(title==''){
			alert('您的咨询的问题不能为空~');$("#title").focus();return false;
		}
		if(tel==''){
			alert('您的手机号不能为空~');$("#tel").focus();return false;
		}
		if(body==''){
			alert('问题描述不能为空~');$("#body").focus();return false;
		}
		return true;
	}
	function get_fields(tid,id){
		var id = arguments[1]?arguments[1]:0;
		$.post("{fun U('Common/get_fields')}",{molds:'message',tid:tid,id:id},function(r){
			var res = JSON.parse(r);
			console.log(res);
			if(res.code==0){
				$("#ext_fields").html(res.tpl); 
				/*
				var html = '';
				var len = res.fields_list.length;
				if(len>0){
					//根据对应的字段，进行HTML设计
					for(var i=0;i<len;i++){
						if(res.fields_list[i].field=='email'){
							html+='<div class="form-group"><label>您的邮箱</label><input name="email" id="email" class="form-control" type="email"></div>';
						}
					}
					
				}
				$("#ext_fields").html(html);
				*/
			}
		});
	}
	$(document).ready(function(){
		 get_fields({$type['id']});
	});
	
	</script></textarea><button onclick="copyTextarea()">COPY</button>
</div>
          </div>
          <div class="code-tips">
            <span>Tips</span>建议参考ajax提交留言
          </div>
        </div>

        <div class="code-box code-para">
          <h3>留言参数 <span>(点击即复制)</span></h3>
          <button onclick="copyText()"><span class="copy">name="title"</span><span>留言标题必传</span></button>
          <button onclick="copyText()"><span class="copy">name="user"</span><span>用户名</span></button>
          <button onclick="copyText()"><span class="copy">name="email"</span><span>邮箱</span></button>
          <button onclick="copyText()"><span class="copy">name="tel"</span><span>电话</span></button>
          <button onclick="copyText()"><span class="copy">name="body"</span><span>内容</span></button>
          <button onclick="copyText()"><span class="copy">name="xxx"</span><span>其他字段自己设</span></button>
        </div>
        <div class="code-box code-label">
          <h3>留言标签 <span>(点击即复制)</span></h3>
          <button onclick="copyText()"><span class="copy">type="hidden"</span><span>隐藏</span></button>
          <button onclick="copyText()"><span class="copy">title</span><span>留言标题必传</span></button>
          <button onclick="copyText()"><span class="copy">user</span><span>用户名</span></button>
          <button onclick="copyText()"><span class="copy">email</span><span>邮箱</span></button>
          <button onclick="copyText()"><span class="copy">tel</span><span>电话</span></button>
          <button onclick="copyText()"><span class="copy">body</span><span>内容</span></button>
          <button onclick="copyText()"><span class="copy">xxx</span><span>其他字段自己设</span></button>
          <input type="text" id="input" value="12345" style="opacity: 0;">
        </div>
        
      </div>
    </div>
  </div>
</div>
<script src="static/js/jquery-1.10.2.js"></script>
<script src="static/js/base.js"></script>
</body>
</html>